import request from '../utils/request'
// 搜索对接在线客服
export function searchOnlineAdmin() {
  return request({
    url: '/chat/searchOnlineAdmin',
    method: 'get'
  })
}
//获取与当前管理员对接的聊天室
export function getChatRoomByAdminId() {
  return request({
    url: '/chat/chatRoom', 
    method: 'get'
  })
}
//结束对话
export function endChatRoom(userId) {
  return request({
    url: '/chat/close',
    method: 'post',
    params: {
      userId
    }
  })
}
//查询与该用户的历史聊天记录
export function getUserChatHistory(userId) {
  return request({
    url: '/chat/getUserChatHistory',
    method: 'get',
    params: {
      userId
    }
  })
}
//查询用户的历史聊天记录
export function getChatHistory() {
  return request({
    url: '/chat/getChatHistory',
    method: 'get',
  })
}

